home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / comm / lib232.zip / INET-OFF.SLT < prev    next >
Text File  |  1990-10-14  |  2KB  |  65 lines

  1. //////////////////////////////// INET-OFF.SLT /////////////////////////////////
  2. //
  3. //  DESCRIPTION:  This is a sample script which demonstrates the use of the
  4. //  Custom Logoff Script function, available in each Liberator Configuration.
  5. //  The Liberator will call the Custom Logoff Script when the 'Thanks for
  6. //  calling' message (also user-definable) is received from PCBoard.  Once the
  7. //  script completes, The Liberator will perform Qmail packet maintenance (if
  8. //  any is required), and reset the capture file, etc.  If you choose not to
  9. //  disconnect from PCBoard, the script will not be called.
  10. //
  11. //  INSTRUCTIONS:  Edit the inet_logoff_command and the delay if necessary,
  12. //  then type the name INET-OFF in the Custom Logoff Script option of any 
  13. //  Configuration (screen 1).  You must compile this script before use, by
  14. //  typing the command CS INET-OFF from DOS.
  15.  
  16. int d =                         5;        // response delay (10ths)
  17. str inet_logoff_command[] =    "BYE";
  18.  
  19. //
  20. //////////////////////////////////////////////////////////////////////////////
  21. main()
  22. {
  23.  int t1,
  24.      t2,
  25.      tmark,
  26.      stat;
  27.  
  28.  if (!carrier())
  29.   return(0);
  30.  
  31.  t1 = track("iNet command: ", 0);
  32.  t2 = track("DATAPAC: call cleared", 0);
  33.  
  34.  tmark = timer_start(1200);                 // 2 minutes
  35.  
  36.  while (!time_up(tmark) && carrier())
  37.   {
  38.    terminal();
  39.    stat = track_hit(0);
  40.    
  41.    if (stat == t1)                          // send iNet logoff
  42.     {
  43.      delay_scr(d);
  44.      cputs(inet_logoff_command);
  45.      cputc('^M');
  46.     }
  47.    
  48.    else if (stat == t2)                     // call cleared
  49.     {
  50.      delay_scr(20);
  51.      break;
  52.     }
  53.   }
  54.  
  55.  track_free(0);
  56.  timer_free(tmark);
  57.  
  58.  while(carrier())   // continue hanging up, until the connection is broken
  59.   {
  60.    hangup();
  61.    delay_scr(50);
  62.   }
  63. }
  64.  
  65. /////////////////////////////// End of file //////////////////////////////////